import Vue from "vue"
import VueRouter from  "vue-router"

const Home =()=> import('../views/home/MyHome')
const Cart=()=>import('../views/cart/MyCart')
const Category=()=>import('../views/category/MyCategory')
const Profile=()=>import('../views/profile/MyProfile')
const Detail=()=>import('../views/detail/GoodsDetail')
Vue.use(VueRouter)
const routes=[
    {
        path:'/',
        redirect:'/home'
    },
    {
        path: '/home',
        component:Home
    },
    {
        path: '/cart',
        component:Cart
    },
    {
        path: '/category',
        component:Category
    },
    {
        path: '/profile',
        component:Profile
    },
    {
        name:'detail',
        path: '/detail/:iid',
        component:Detail
    }
]
const router =new VueRouter({
    routes:routes,
    mode:'history'
})
export default router
